#ifndef _KC_TCPCOMMON_H__KC_
#define _KC_TCPCOMMON_H__KC_

#include <string>
#include "../CommCommon.h"

namespace kc_sf
{
	// TODO obsluga sygnalu
	class TCPCommon : public CommCommon
	{
		public:

			TCPCommon( int sockfd, unsigned int max_line_length );

			void setToNonBlocking();

			CommResult sendData( const std::string &what, int timeout_s );
			CommResult recvData( std::string &to, const std::string &until_str, int timeout_s );
			CommResult recvData( std::string &to, int timeout_s, unsigned long how_many_bytes = -1 );

		private:

			int tcp_sockfd;
			unsigned int tcp_max_line_length;
	};
}

#endif // _KC_TCPCOMMON_H__KC_
